class BookshopDepartmentsController < ApplicationController
  # GET /bookshop_departments
  # GET /bookshop_departments.xml
  def index
    @bookshop_departments = BookshopDepartment.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @bookshop_departments }
    end
  end

  # GET /bookshop_departments/1
  # GET /bookshop_departments/1.xml
  def show
    @bookshop_department = BookshopDepartment.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @bookshop_department }
    end
  end

  # GET /bookshop_departments/new
  # GET /bookshop_departments/new.xml
  def new
    @bookshop_department = BookshopDepartment.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @bookshop_department }
    end
  end

  # GET /bookshop_departments/1/edit
  def edit
    @bookshop_department = BookshopDepartment.find(params[:id])
  end

  # POST /bookshop_departments
  # POST /bookshop_departments.xml
  def create
    @bookshop_department = BookshopDepartment.new(params[:bookshop_department])

    respond_to do |format|
      if @bookshop_department.save
        flash[:notice] = 'BookshopDepartment was successfully created.'
        format.html { redirect_to(@bookshop_department) }
        format.xml  { render :xml => @bookshop_department, :status => :created, :location => @bookshop_department }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @bookshop_department.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /bookshop_departments/1
  # PUT /bookshop_departments/1.xml
  def update
    @bookshop_department = BookshopDepartment.find(params[:id])

    respond_to do |format|
      if @bookshop_department.update_attributes(params[:bookshop_department])
        flash[:notice] = 'BookshopDepartment was successfully updated.'
        format.html { redirect_to(@bookshop_department) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @bookshop_department.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /bookshop_departments/1
  # DELETE /bookshop_departments/1.xml
  def destroy
    @bookshop_department = BookshopDepartment.find(params[:id])
    @bookshop_department.destroy

    respond_to do |format|
      format.html { redirect_to(bookshop_departments_url) }
      format.xml  { head :ok }
    end
  end
end
